Add model builder for Qwen2_5_VLTextModel#1882
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request adds model builder support for the Qwen 2.5 VL text model, enabling ONNX export of the language component of this multimodal model. The implementation introduces a new Qwen25VLTextModel class that handles the unique architectural requirements of Qwen 2.5 VL, including 3D positional embeddings and Multi-Dimensional RoPE (MRoPE).
Key changes:
- New
Qwen25VLTextModelclass that inherits fromQwenModelinstead ofMistralModel - Implementation of dynamic 3D RoPE computation using MRoPE for multimodal positional encoding
- Comprehensive parity test to validate ONNX model outputs against Hugging Face models
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/python/py/models/builders/qwen.py | Adds Qwen25VLTextModel class with MRoPE implementation, custom RoPE cache generation, and model-specific initialization overrides |
| src/python/py/models/builders/base.py | Adds MRoPE configuration support and removes trailing whitespace |
| src/python/py/models/builder.py | Registers Qwen2_5_VLForConditionalGeneration architecture and updates make_model signature to accept config parameter |
| src/python/py/models/builders/init.py | Exports new Qwen25VLTextModel class |
| src/python/py/models/builders/phi.py | Removes blank line (whitespace cleanup) |
| test/python/models/qwen_2.5_vl/test_qwen_2.5_vl.py | Adds comprehensive parity test comparing ONNX vs Hugging Face outputs for prefill and decode steps |
| test/python/models/qwen_2.5_vl/run.sh | Provides shell script to build and test models at different precisions (fp32, bf16, fp16) |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
4 tasks
b103e50 to
88964ad
Compare
kunal-vaishnavi
approved these changes
Dec 2, 2025
kunal-vaishnavi
pushed a commit
that referenced
this pull request
Dec 5, 2025
Add model builder for Qwen2_5_VLTextModel. Snippet of example test output: ``` onnxruntime-genai/test/python/models/qwen_2.5_vl$ bash run.sh fp32 ... --- Comparing Decode Logits --- Logits: PASS --- Comparing Decode KV Cache --- KV Cache (all 72 tensors): PASS ✅ Decode Parity Test Passed! ============================== 🎉 All Parity Tests Passed! 🎉 ============================== --- fp32 run complete --- ``` --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add model builder for Qwen2_5_VLTextModel.
Snippet of example test output: